//
//  KMAlertView.m
//  OpenDoor
//
//  Created by cnmobi on 15/6/6.
//  Copyright (c) 2015年 CNMOBI. All rights reserved.
//

#import "KMAlertView.h"

@implementation KMAlertView
{
    KMAleartViewClickBtnBlock clickBtnBlock;
    
}

- (id)initWithTitle:(NSString *)titleStr message:(NSString *)messageStr cancelButtonTitle:(NSString *)cancelStr clickButton:(KMAleartViewClickBtnBlock)block otherButtonTitles:(NSString *)otherStr
{
    self = [super initWithTitle:titleStr message:messageStr delegate:self cancelButtonTitle:cancelStr otherButtonTitles:otherStr, nil];
    
    if (clickBtnBlock!=nil) {
        clickBtnBlock=nil;
    }
    if (block) {
        clickBtnBlock=block;
    }
    
    return self;
}



- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
    
    clickBtnBlock(buttonIndex);
    
}


@end
